package com.xugui.learn.common.result;

import lombok.Getter;

@Getter
public enum ResultCode {

    // 系统级别（1位）+ 模块（2位）+ 错误类型（2位）
    OK(200,"操作成功"),
    FAIL(500, "操作失败"),

    PARAM_ERROR(10001,"请求参数错误"),
    UNAUTHORIZED(10002,"未登录"),
    FORBIDDEN(10003,"无权限访问"),

    RESOURCE_NOT_FOUND(20001,"资源不存在"),
    BUSINESS_CONFLICT(20002,"业务冲突"),
    SERVER_ERROR(50000,"服务器异常");

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
